from fastapi import APIRouter, Depends, HTTPException
from sqlalchemy.orm import Session
from db import get_db
from models import Root
router = APIRouter(prefix="/api/root", tags=["超级用户"])
@router.delete("/{user_id}")

def delete_user(
                Root_id: int, db: Session = Depends(get_db)):
    user = db.query(Root).filter(Root.id == Root_id).first()
    if user is None:
        raise HTTPException
    db.delete(user)
    db.commit()
    return {"message": "删除成功"}
